package com.lancoo.edu.platform.operation.commons.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 系统健康信息返回结果
 * @author pky
 */
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class HealthResult<T> extends BaseResult {
    private int error = 0;
    private String msg = "请求成功";
    private T data = null;

    /**
     * 固定状态码和说明的构造器
     * @param attributes 详情信息
     */
    public HealthResult(T attributes) {
        this.data = attributes;
    }

    /**
     * 固定状态码和说明的构造器
     * @param error 状态码
     * @param msg 说明
     */
    public HealthResult(int error, String msg) {
        this.error = error;
        this.msg = msg;
    }
    /**
     * 指定状态码和说明的构造器
     * @param error 状态码
     * @param msg 说明
     * @param attributes 详情信息
     */
    public HealthResult(int error, String msg, T attributes) {
        this.error = error;
        this.msg = msg;
        this.data = attributes;
    }
}
